package com.s63.modules.token;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TokenConfig {

    @Bean
    @ConditionalOnProperty(prefix = "s63", name = "token", havingValue = "default", matchIfMissing = true)
    public DefaultTokenService defaultTokenService() {
        System.out.println("DefaultTokenService实例化");
        return new DefaultTokenService();
    }

    @Bean
    @ConditionalOnProperty(prefix = "s63", name = "token", havingValue = "jwt")
    public JwtTokenService jwtTokenService() {
        System.out.println("JwtTokenService实例化");
        return new JwtTokenService();
    }
}
